package com.wyvoid.forum.dao.hibernate;

import java.util.List;
import com.wyvoid.forum.domain.FriendLink;
import com.wyvoid.forum.dao.IFriendLinkDAO;
import com.wyvoid.core.persistent.hibernate.HibernateDAO;

/**
 * 友情链接Hibernate数据处理实现
 *
 */
public class FriendLinkDAO extends HibernateDAO<FriendLink> implements IFriendLinkDAO {

    /**
     * 查找全部的友情链接
     *
     * @param logo 是否为友情链接
     * @return List 友情链接列表
     */
    public List<FriendLink> findLinks(int logo) {
        return doQueryList("from Link as link where link.isLogo='" + logo + "' order by link.displayOrder desc", true);
    }


    /**
     * 查询全部的友情链接列表
     *
     * @return List 友情链接列表
     */
    public List findLinks() {
        return doQueryList("from Link as link order by link.displayOrder desc", true);
    }
}